﻿using Xejen.Communication.Http.Configuration;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;

namespace Xejen.Communication.Http.Abstract
{
    /// <summary>
    /// 用于创建一个http请求调用
    /// </summary>
    /// <creator>marc</creator>
    /// <typeparam name="THttpInvoker">
    /// 驱动类型
    /// <para>
    /// 如HttpClient、HttpWebRequest、WebRequest/WebResponse、HttpClientFactory、RestSharp
    /// </para>
    /// <para>
    /// 本程序仅计划实现HttpClient、HttpWebRequest、WebRequest/WebResponse，若要其它方式，请自行扩展
    /// </para>
    /// </typeparam>
    public interface IHttpInvokerCreator<THttpInvoker>
    {
        ///// <summary>
        ///// 构建一个http请求驱动
        ///// </summary>
        ///// <param name="config"><inheritdoc cref="HttpConfig" path="/summary"/></param>
        ///// <param name="token">请求时所带的token令牌</param>
        ///// <param name="headers">请求时所带的头部信息</param>
        ///// <returns></returns>
        //THttpInvoker Create(HttpConfig config, string token = default, NameValueCollection headers = default);
        /// <summary>
        /// 构建一个http请求驱动
        /// </summary>
        /// <param name="config"><inheritdoc cref="HttpConfig" path="/summary"/></param>
        /// <param name="headers">请求时所带的头部信息</param>
        /// <returns></returns>
        THttpInvoker Create(HttpConfig config, NameValueCollection headers );
    }
}
